package masterjava.reporting.client.dao;

import com.google.gwt.user.client.rpc.AsyncCallback;
import masterjava.common.client.gwt.dao.ClientDao;
import masterjava.reporting.shared.entity.AlgoStrategy;

import java.util.List;

/**
 * User: Grigory Kislin
 * Date: 29/06/11
 */
public class AlgoStrategyDao extends ClientDao<AlgoStrategy, Long> {
    private static AlgoStrategyDao INSTANCE = new AlgoStrategyDao();

    private AlgoStrategyDao() {
        super(AlgoStrategy.class);
    }

    public void getByUserId(Long userId, AsyncCallback<List<AlgoStrategy>> callback) {
        findByNamedQueryAndNamedParam(AlgoStrategy.FIND_BY_USER_ID, AlgoStrategy.USER_ID, userId, callback);
    }

    public static AlgoStrategyDao get() {
        return INSTANCE;
    }
}
